package models

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId     int     `gorm:"type:int;not null;comment:用户id"`
	HouseId    int     `gorm:"type:int;not null;comment:房源id"`
	Types      int     `gorm:"type:int;default:1;comment:支付类型(1-支付宝,2-微信)"`
	OutTradeNo string  `gorm:"type:varchar(20);comment:订单号"`
	Price      float64 `gorm:"type:decimal(10,2);comment:支付金额"`
}

func (o *Order) Create() error {
	return DB.Create(&o).Error
}
